package com.sc.nft.entity.vo.ecology;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sc.nft.enums.EcologyPointsEnum;
import com.sc.nft.enums.UserEcologyExpenditureTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class UserEcologyDetailVO {

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "类型")
    @JsonIgnore
    private EcologyPointsEnum type;

    @ApiModelProperty(value = "类型名称")
    private String typeName;

    @ApiModelProperty(value = "燃料数量")
    private String amount;

    @ApiModelProperty(value = "燃料图片")
    private String image;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    public void setAmount(BigDecimal amount) {
        this.amount = amount.setScale(2,BigDecimal.ROUND_DOWN).toPlainString();
    }
}
